/*
 * ConditionValue.h
 *
 *  Created on: 01.10.2012
 *      Author: Lapchinskiy
 */
#ifndef CONDITIONVALUE_H_
#define CONDITIONVALUE_H_
#define PLUS    &ConditionVariable<uint32_t>::operator +
#define MINUS     &ConditionVariable<uint32_t>::operator -
#define EQUAL &ConditionVariable<uint32_t>::operator ==
#define MORE_EQUAL &ConditionVariable<uint32_t>::operator >=
#define MOD &ConditionVariable<uint32_t>::operator %


template<class T>
class ConditionVariable {
private:
	T* value;
public:
	ConditionVariable(T* value);
	ConditionVariable();
	T operator +(T*);
	T operator -(T*);
	T operator %(T*);
	bool operator ==(T*);
	bool operator >=(T*);
	//bool operator !=(T*);
	~ConditionVariable();
	T* getValue() const {
		return value;
	}

	void setValue(T* value) {
		this->value = value;
	}
};

template<class T>
bool ConditionVariable<T>::operator ==(T* conditionVariable) {
	return (*(this->value) == *conditionVariable);

}
template<class T>
bool ConditionVariable<T>::operator >=(T* conditionVariable) {
	return (*(this->value) >= *conditionVariable);

}
template<class T>
T ConditionVariable<T>::operator %(T* conditionVariable) {
	return (*(this->value) % *conditionVariable);

}
//template<class T>
//bool ConditionVariable<T>::operator !=(T* conditionVariable) {
//	return (*(this->value)!=*conditionVariable);
//
//}
template<class T>
T ConditionVariable<T>::operator +(T* conditionVariable) {
	return (*(this->value) + *conditionVariable);

}

template<class T>
T ConditionVariable<T>::operator -(T* conditionVariable) {
	return (*(this->value) - *conditionVariable);
}

template<class T>
ConditionVariable<T>::ConditionVariable(T* value) {
	this->value = value;
}

template<class T>
ConditionVariable<T>::ConditionVariable() {
}

template<class T>
ConditionVariable<T>::~ConditionVariable() {
	//delete value;
}

#endif /* CONDITIONVALUE_H_ */
